// Project name:JavaRedis
// Creator:muhong
// Date time:2022/11/25,10:28 下午
// Name:Channel

package org.gmh.channel;

import org.gmh.channel.handler.ChannelOutboundInvoker;
import org.gmh.channel.handler.ChannelPipeline;

import java.net.SocketAddress;

public interface Channel extends ChannelOutboundInvoker {
    
    EventLoop eventLoop();

    Channel parent();

    boolean isRegistered();

    Unsafe unsafe();

    ChannelPipeline pipeline();

    ChannelFuture closeFuture();

    boolean isActive();

    boolean isOpen();

    interface Unsafe {

        void bind(SocketAddress socketAddress);

        void register(EventLoop eventLoop, ChannelPromise promise);

        void write(Object msg);

        void close(ChannelPromise promise);

        void closeForcibly();

        ChannelPromise voidPromise();
    }
}
